import $service from '../../service.js'
const app = getApp()
Component({
  properties: {
    doctorList: {
      type: Array,
      value: [],
    },
    isShowFeeCard: {
      type: Boolean,
      value: false,
    }
  },
  data: {
    feeData: null,
    isFee: false
  },
  methods: {
    //页面跳转
    gotopage(e) {
      if (!$service.getStore('userInfo')) { //判断是否登录
        $service.loginuserid()
        return
      }
      var num = e.currentTarget.dataset.num;
      $service.openPage('/pages/user_side/index/index_doctorlist/index_doctor_details/index_doctor_details?doctorId=' + this.data.doctorList[num].id)
    },
    // 获取问诊费订单
    getConsultationFee() {
       app.http.getConsultationFee().then(res => {
        if (res.data) {
          let {inquiryType} = res.data;
          this.data.isFee = inquiryType == 1 || inquiryType == 2 ? true : false
          } else {
            this.data.isFee = false
          }
        this.setData({
          isFee: this.data.isFee,
          feeData: res.data
        })
      })
    },
  }
})